import request from '@/utils/request'

// 查询上传POST列表
export function listPost(query) {
  return request({
    url: '/amazon_us/post/list',
    method: 'get',
    params: query
  })
}

// 查询上传POST详细
export function getPost(id) {
  return request({
    url: '/amazon_us/post/' + id,
    method: 'get'
  })
}

// 根据主ASIN获取图片链接列表
export function getImagesByMainAsin(mainAsin) {
  return request({
    url: '/amazon_us/post/images/' + mainAsin,
    method: 'get'
  })
}

// 新增上传POST
export function addPost(data) {
  return request({
    url: '/amazon_us/post',
    method: 'post',
    data: data
  })
}

// 修改上传POST
export function updatePost(data) {
  return request({
    url: '/amazon_us/post',
    method: 'put',
    data: data
  })
}

// 删除上传POST
export function delPost(id) {
  return request({
    url: '/amazon_us/post/' + id,
    method: 'delete'
  })
}
